Skip to content

Simplify markdown/quarto config with vim-pencil plugin#84

Merged
michaelbarton merged 6 commits intomasterfrom
claude/fix-vim-qmd-behavior-GySkn
Mar 12, 2026
Merged

Simplify markdown/quarto config with vim-pencil plugin#84
michaelbarton merged 6 commits intomasterfrom
claude/fix-vim-qmd-behavior-GySkn

Conversation

@michaelbarton
Copy link
Owner

Summary

Refactored markdown and quarto filetype configurations to use the vim-pencil plugin for text formatting, removing manual configuration of formatting options and text wrapping behavior. Also removed R language support and cleaned up unused plugin configurations.

Key Changes

  • Added vim-pencil plugin (nvim/lua/plugins/pencil.lua): New plugin configuration with hard wrap mode, 80 character textwidth, and autoformat enabled for markdown, quarto, and vimwiki filetypes
  • Simplified markdown config (nvim/ftplugin/markdown.lua): Replaced 28 lines of manual formatting options (formatoptions, textwidth, formatlistpat, etc.) with a single PencilHard command call, keeping only tab/indent settings
  • Simplified quarto config (nvim/ftplugin/quarto.lua): Removed manual wrap/linebreak settings and replaced with PencilHard command; removed unused buffer variables
  • Disabled quarto completions (nvim/lua/plugins/quarto.lua): Added opts to disable completion in both quarto-nvim and otter.nvim plugins
  • Removed R language support: Deleted R.nvim plugin configuration and its build workaround, removed R from treesitter ensure_installed and lang_to_ext mappings, removed R language import from lazy.lua, and removed R-related ansible task
  • Removed unused languages: Dropped html, javascript, and typescript from treesitter configuration
  • Updated ansible tasks (ansible/tasks/neovim.yml): Removed pyright dependency and replaced R.nvim tree-sitter workaround task with a simple Lazy! clean command
  • Removed pyright from ansible package list

Implementation Details

The vim-pencil plugin consolidates text formatting behavior that was previously scattered across multiple configuration files. The PencilHard command applies consistent hard-wrap formatting with proper indentation and word-boundary wrapping, eliminating the need for manual vim option configuration.

https://claude.ai/code/session_01HBreTNcQgKZrD7azocwiaD

claude added 6 commits March 12, 2026 20:59
Otter.nvim was feeding R language server completions into the prose/markdown
areas of .qmd files. Disable otter's completion source so the autocomplete
popup doesn't appear when writing text outside code chunks.

https://claude.ai/code/session_01HBreTNcQgKZrD7azocwiaD
R is unused — all qmd code sections use Python. Removes the LazyVim R
language extra, the R.nvim plugin (and its build workaround), and the R
entry from conform's injected formatter config.

https://claude.ai/code/session_01HBreTNcQgKZrD7azocwiaD
Unused — remove JS treesitter parser and JS/TS entries from conform's
injected formatter config.

https://claude.ai/code/session_01HBreTNcQgKZrD7azocwiaD
Replace the tree-sitter-rout clone step (no longer needed after removing R
support) with a Lazy clean step to remove unused plugin files during setup.

https://claude.ai/code/session_01HBreTNcQgKZrD7azocwiaD
- Remove html treesitter parser (unused)
- Remove pyright from Ansible venv (already installed via Mason by LazyVim)
- Clean up ftplugin/markdown.lua: remove vim-markdown plugin globals (plugin
  not installed), remove redundant BufWinEnter autocmd that stacked on every
  buffer load, use opt_local for folding/conceal instead

https://claude.ai/code/session_01HBreTNcQgKZrD7azocwiaD
Replace manual formatoptions/wrap config with vim-pencil in hard wrap
mode. This gives reliable prose wrapping that understands markdown
structures (lists, blockquotes, code blocks) without needing to
manually configure formatoptions.

- Add pencil.lua plugin config (hard wrap, tw=80, autoformat)
- Simplify markdown ftplugin: PencilHard replaces formatoptions
- Simplify quarto ftplugin: PencilHard replaces manual soft wrap,
  remove unused R-mode variables

https://claude.ai/code/session_01HBreTNcQgKZrD7azocwiaD
@michaelbarton michaelbarton merged commit 027d6cd into master Mar 12, 2026
2 checks passed
@michaelbarton michaelbarton deleted the claude/fix-vim-qmd-behavior-GySkn branch March 12, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants